| Conditions | 2 |
| Total Lines | 9 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | export function isWordInWordlist(word: string, wordlist: string[]): boolean { |
||
| 7 | |||
| 8 | export function getSuggestions(input: string, wordlist: string[], maxSuggestions: number = 10): string[] { |
||
| 9 | const normalizedInput = input.trim().toLowerCase(); |
||
| 10 | |||
| 11 | if (!normalizedInput) { |
||
| 12 | return []; |
||
| 13 | } |
||
| 14 | |||
| 15 | return wordlist.filter(word => word.toLowerCase().startsWith(normalizedInput)).slice(0, maxSuggestions); |
||
| 16 | } |
||
| 44 |